Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CLI driver selection #1348

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cme
Copy link
Contributor

@cme cme commented Aug 17, 2021

  • Make driver id on command line case-insensitive
  • Add PulseAudio, CoreAudio, PortAudio to the GUI app's command line

Really there should be a driver registry or similar to handle this sort of thing

@theGreatWhiteShark
Copy link
Contributor

Just a thought. Which drivers are supported for a specific version/platform of Hydrogen should be known at compile time, right? You introduced a list of available drivers in startAudioDriver(). Maybe we could create this list at compile time and use it for both the driver selection, the parsing of the command line arguments, and the messages printed using hydrogen --help. After all, the code seems to be tailored for Linux versions only but selecting the driver from CLI may be useful on Mac or Windows too.

@cme
Copy link
Contributor Author

cme commented Aug 18, 2021

Just a thought. Which drivers are supported for a specific version/platform of Hydrogen should be known at compile time, right? You introduced a list of available drivers in startAudioDriver(). Maybe we could create this list at compile time and use it for both the driver selection, the parsing of the command line arguments, and the messages printed using hydrogen --help. After all, the code seems to be tailored for Linux versions only but selecting the driver from CLI may be useful on Mac or Windows too.

Yeah, after thinking about this a little today, I want to refactor these things into a single driver registry class that knows about all the drivers available, their names etc, and can also store some more status for display in the driver info text box (because dumping driver problems to the errorlog doesn't really seem the most helpful way of telling the user when things change.

Also having been in the PreferencesDialog code for adding PortAudio things, having a single source for driver info would make a lot of that code a lot cleaner too.

@cme cme marked this pull request as draft August 18, 2021 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants